<?php
class skillmatch extends head {
 function skillmatch() {
  $this->table = "skillmatch";
  $this->getmetadata();
  $this->maintainhist = true;
  $this->header[2] = "";
  $_SESSION[$this->table] = $this;
 }
 function createblank() {
  parent::createblank();
 }

 function newcounter() {
  return '0';
 }

 function applyrefs($forcelookup="Y") {
  parent::applyrefs();
  $this->validatefield(5,"PROCESS",$forcelookup);
  $this->validatefield(6,"EMPLOYEE",$forcelookup); 
 }
 
 function showform() {
  echo '<head>';
  echo SCRIPTS;
  echo '</head>';
	echo "<body onload='document.form.f0.focus()'>";
  echo "<h1>Skillmatch Setup</h1>"; 
  echo "<form name='form' method=GET>";
  echo "<input type=hidden name=res value=''>";
  echo "<table>";
  echo $this->htmlrow('5','Process');
  echo $this->htmlrow('6','Employee');
  
  echo "</table>";
  echo '<input class=bt accesskey=A type=submit name=sub value=Apply>';
  echo '<input class=bt accesskey=S type=submit name=sub value=Save>';
  echo "<button class=bt onclick=rest('skillmatchmanage.php')><span>Restart</span></button>"; 
  echo "</form>"; 
 }

 function applyfromrequest() {
  $this->valid = true;
  // Goes through request. Applies if legal, otherwise error.
  $this->valids = array_fill(0,$this->atts,'');
  $this->applyrefs("N");
 
  $this->valid = every($this->valids,"");
  if ($this->valid) {
   if ($this->header[5] == "") $this->valids[5] = "Incomplete";
   if ($this->header[6] == "") $this->valids[6] = "Incomplete";
   $this->valid = every($this->valids,"");   
  }
   
 }
}
?>